<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>effect</title>
</head>
<body>
  <script type="module">
    import { reactive, effect } from '../dist/index.js' 
    const production = reactive({
      name: 'iPhone',
      price: 5000,
      count: 3,
    })

    let total = 0
    effect(() => {
        total = production.price * production.count
    })
    console.log(total)
    
    production.price = 4000
    console.log(total)

    production.count = 1
    console.log(total)
  </script>
</body>
</html>